<?php
error_reporting(0);
$isadmin=1; 
include_once '../comm/config.php';
include_once '../comm/checkpostandget.php';
include_once 'check.php';
$id=$_GET['id']; 
$top=$_GET['top'];

$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die(ERR_DB);
}
else
{
	mysql_query("set names utf8");
	mysql_select_db($dbname);
	if($top=='1'){
		$sql="select max(tuijian) as maxid from ".$BIAOTOU."shop";
		$rs = mysql_query($sql);
		while ($row = mysql_fetch_array($rs)){
			$maxid=$row['maxid']+1;
		}
		
		$sql="update ".$BIAOTOU."shop set tuijian=".$maxid." where id=".$id;
		mysql_query($sql);
	}else{
		$sql="update ".$BIAOTOU."shop set tuijian=0 where id=".$id;
		mysql_query($sql);
	}
}
echo "<script language=javascript>window.location='shoplist.php';</script>"; 
mysql_close($link);
?>